package com.atguigu.pojo;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * projectName: com.atguigu.pojo
 *
 * @author: 赵伟风
 * description:
 */

//要求key的最后一层必须和属性名相同
//批量配置参数读取 springboot的技术
@ConfigurationProperties(prefix = "tg.user")
@Data
@Component
public class User {

//    @Value("${tg.user.name}") - spring提供
    private String name;
//    @Value("${tg.user.age}") - spring提供
    private int age;
    private String gender;

}
